using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Windows.Forms;

namespace UNGDUNG
{
    public partial class frmDatabase : Form
    {
        
        public frmDatabase()
        {
            InitializeComponent();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            SendKeys.SendWait("{F1}"); 
        }
        HelpProvider hp;
        private void frmDatabase_Load(object sender, EventArgs e)
        {

            AssignHelp();            
            ShowDatabase(clsStatic.strInput);
            
        }
        void ShowDatabase(string name)
        {
            clsDatabases cls = new clsDatabases("");
            object[] info = cls.ShowDatabase(name);
            if (info != null)
            {
                label1.Text ="Name: " +  info[0].ToString();
                label2.Text = "Created: " + info[1].ToString();
                label3.Text = "Size(KB): " + info[2].ToString();
                FileInfo f = new FileInfo(info[3].ToString());
                label4.Text = "Space (KB): " + (f.Length / 1024).ToString();
            }
            listView1.Columns.Add("Name", 100);
            listView1.Columns.Add("Location", 100);
            listView1.Columns.Add("Size", 70);
            listView1.Columns.Add("Group", 70);
            ListViewItem Item = new ListViewItem(info[0].ToString());
            Item.SubItems.Add(info[3].ToString());
            Item.SubItems.Add(info[2].ToString());
            Item.SubItems.Add(info[4].ToString());
            listView1.Items.Add(Item);
        }
        void  AssignHelp()
        {                        
            hp = new HelpProvider();
            hp.HelpNamespace = Application.StartupPath.Replace(@"\bin\Debug", "") + @"\cs.chm";
            hp.SetHelpKeyword(this, "Database");
            hp.SetHelpNavigator(this, HelpNavigator.Index);
            hp.SetHelpString(this, "Database");
            hp.SetShowHelp(this, true);
        }
         
    

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}